package com.hzdp.jobs;

import com.hzdp.enums.SourceCompany;
import com.hzdp.handles.category.CategoryProcessor;
import com.hzdp.spring.BeanFactory;
import org.apache.commons.collections.CollectionUtils;

import java.util.List;

/**
 * Created by lyp on 15/12/26.
 */
public class CategoryProcessJob {

    private static final int companyId = SourceCompany.JD.id;

    public static void main(String[] args) {
        CategoryProcessor job = (CategoryProcessor) BeanFactory.getInstance().getBean("categoryProcessor");
        List<String> allCompanyCategories = job.getAllCompanyCategories(companyId);
        if(CollectionUtils.isEmpty(allCompanyCategories)){
            return;
        }
        for(String companyCategory : allCompanyCategories){
            job.hanld(companyId,companyCategory);
        }
    }
}
